package com.xiaodong.j20240319.config;

import com.xiaodong.j20240319.model.UserInfo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfig {


    @Bean
    public UserInfo userInfo1() {
        UserInfo userInfo = new UserInfo();
        userInfo.setId(5);
        userInfo.setAge(18);
        userInfo.setName("张三");
        return userInfo;
    }
    @Bean
    public UserInfo userInfo2(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(2);
        userInfo.setAge(20);
        userInfo.setName("李四");
        return userInfo;
    }
}